/* SPDX-License-Identifier: GPL-2.0 */

/*
 * Copyright (C) 2016-2018, LomboTech Co.Ltd.
 * Author: lomboswer <lomboswer@lombotech.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

#ifndef __LOBOM_PDM_H
#define __LOBOM_PDM_H

/* PDM REGS */
#define PDM_VER		(0x00000000)
#define PDM_CTRL	(0x00000010)
#define PDM_CHAN        (0x00000014)
#define PDM_START       (0x00000020)
#define PDM_RXFFR       (0x00000030)
#define PDM_ISR         (0x00000040)
#define PDM_IE          (0x00000044)
#define PDM_ICR         (0x00000048)
#define PDM_RFCR        (0x00000050)
#define PDM_RXDMA       (0x00000060)
#define PDM_MAX_REG     (0x00000064)

#define LOMBO_PDM_DMA_BURST_SIZE	(8) /* size * width: 4*4 = 16 bytes */
#define DMA_BUFFER_MAX		(1024*64)
#define PERIOD_BYTES_MIN	32
#define PERIOD_BYTES_MAX	(PAGE_SIZE*2)
#define PERIOD_MIN		1
#define PERIOD_MAX		64
#define PREALLOC_PCM_BUFFER	(1024*64)

#endif /* __LOBOM_PDM_H */

